package com.dragon.mmochat.model.skill.lifeSkill;

import java.io.Serializable;

import com.dragon.mmochat.model.enumType.MmochatLifeSkillType;

//生活技能
public class MmochatLifeSkill implements Serializable {
	private static final long serialVersionUID = 6978200987734444679L;
	private MmochatLifeSkillType type;// 技能类型
	private int level = 0; // 技能等级
	private int exp = 0;// 技能经验

	public MmochatLifeSkillType getType() {
		return type;
	}

	public void setType(MmochatLifeSkillType type) {
		this.type = type;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public void addLevel(int add) {
		level += add;
		level = Math.min(level, type.getMaxLevel());
		level = Math.max(0, level);
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public int getExp() {
		return exp;
	}

	public void setExp(int exp) {
		this.exp = exp;
	}

	public void addExp(int add) {
		exp += add;
		exp = Math.max(0, exp);
	}

}
